#include "Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.h"
#ifdef __cplusplus
extern "C" {
#endif
b3DynamicBvh::sStkNPS* bullet_Newb3DynamicBvhsStkNPS(){
	b3DynamicBvh::sStkNPS* wrap_out = new b3DynamicBvh::sStkNPS();
	return wrap_out;
}

b3DynamicBvh::sStkNPS* bullet_Newb3DynamicBvhsStkNPS1(b3DbvtNode* n,unsigned int m,float v){
	b3DbvtNode const * c_arg_n=(b3DbvtNode const *)(void*)(n);
	unsigned int c_arg_m=m;
	b3Scalar c_arg_v=v;
	b3DynamicBvh::sStkNPS* wrap_out = new b3DynamicBvh::sStkNPS(c_arg_n,c_arg_m,c_arg_v);
	return wrap_out;
}

int bullet_b3DynamicBvhsStkNPS_GetFieldOfMask(b3DynamicBvh::sStkNPS* c_this){
	return (int)(c_this->mask);
}

b3DbvtNode** bullet_b3DynamicBvhsStkNPS_GetFieldOfNode(b3DynamicBvh::sStkNPS* c_this){
	return (b3DbvtNode**)(&c_this->node);
}

float bullet_b3DynamicBvhsStkNPS_GetFieldOfValue(b3DynamicBvh::sStkNPS* c_this){
	return (float)(c_this->value);
}

b3DynamicBvh::sStkNP* bullet_Newb3DynamicBvhsStkNP(b3DbvtNode* n,unsigned int m){
	b3DbvtNode const * c_arg_n=(b3DbvtNode const *)(void*)(n);
	unsigned int c_arg_m=m;
	b3DynamicBvh::sStkNP* wrap_out = new b3DynamicBvh::sStkNP(c_arg_n,c_arg_m);
	return wrap_out;
}

int bullet_b3DynamicBvhsStkNP_GetFieldOfMask(b3DynamicBvh::sStkNP* c_this){
	return (int)(c_this->mask);
}

b3DbvtNode** bullet_b3DynamicBvhsStkNP_GetFieldOfNode(b3DynamicBvh::sStkNP* c_this){
	return (b3DbvtNode**)(&c_this->node);
}

b3DynamicBvh::sStkNN* bullet_Newb3DynamicBvhsStkNN(){
	b3DynamicBvh::sStkNN* wrap_out = new b3DynamicBvh::sStkNN();
	return wrap_out;
}

b3DynamicBvh::sStkNN* bullet_Newb3DynamicBvhsStkNN1(b3DbvtNode* na,b3DbvtNode* nb){
	b3DbvtNode const * c_arg_na=(b3DbvtNode const *)(void*)(na);
	b3DbvtNode const * c_arg_nb=(b3DbvtNode const *)(void*)(nb);
	b3DynamicBvh::sStkNN* wrap_out = new b3DynamicBvh::sStkNN(c_arg_na,c_arg_nb);
	return wrap_out;
}

b3DbvtNode** bullet_b3DynamicBvhsStkNN_GetFieldOfA(b3DynamicBvh::sStkNN* c_this){
	return (b3DbvtNode**)(&c_this->a);
}

b3DbvtNode** bullet_b3DynamicBvhsStkNN_GetFieldOfB(b3DynamicBvh::sStkNN* c_this){
	return (b3DbvtNode**)(&c_this->b);
}

b3DynamicBvh::sStkCLN* bullet_Newb3DynamicBvhsStkCLN(b3DbvtNode* n,b3DbvtNode* p){
	b3DbvtNode const * c_arg_n=(b3DbvtNode const *)(void*)(n);
	b3DbvtNode * c_arg_p=(b3DbvtNode *)(void*)(p);
	b3DynamicBvh::sStkCLN* wrap_out = new b3DynamicBvh::sStkCLN(c_arg_n,c_arg_p);
	return wrap_out;
}

b3DbvtNode** bullet_b3DynamicBvhsStkCLN_GetFieldOfNode(b3DynamicBvh::sStkCLN* c_this){
	return (b3DbvtNode**)(&c_this->node);
}

b3DbvtNode** bullet_b3DynamicBvhsStkCLN_GetFieldOfParent(b3DynamicBvh::sStkCLN* c_this){
	return (b3DbvtNode**)(&c_this->parent);
}

b3DynamicBvh::ICollide* bullet_Newb3DynamicBvhICollide(){
	b3DynamicBvh::ICollide* wrap_out = new b3DynamicBvh::ICollide();
	return wrap_out;
}

bool bullet_b3DynamicBvhICollide_AllLeaves(b3DynamicBvh::ICollide* c_this,b3DbvtNode* tmp_arg0){
	b3DbvtNode const * c_arg_tmp_arg0=(b3DbvtNode const *)(void*)(tmp_arg0);
	bool c_out = c_this->AllLeaves(c_arg_tmp_arg0);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_b3DynamicBvhICollide_Descent(b3DynamicBvh::ICollide* c_this,b3DbvtNode* tmp_arg0){
	b3DbvtNode const * c_arg_tmp_arg0=(b3DbvtNode const *)(void*)(tmp_arg0);
	bool c_out = c_this->Descent(c_arg_tmp_arg0);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_b3DynamicBvhICollide_Process(b3DynamicBvh::ICollide* c_this,b3DbvtNode* tmp_arg0,b3DbvtNode* tmp_arg1){
	b3DbvtNode const * c_arg_tmp_arg0=(b3DbvtNode const *)(void*)(tmp_arg0);
	b3DbvtNode const * c_arg_tmp_arg1=(b3DbvtNode const *)(void*)(tmp_arg1);
	c_this->Process(c_arg_tmp_arg0,c_arg_tmp_arg1);
}

void bullet_b3DynamicBvhICollide_Process1(b3DynamicBvh::ICollide* c_this,b3DbvtNode* tmp_arg0){
	b3DbvtNode const * c_arg_tmp_arg0=(b3DbvtNode const *)(void*)(tmp_arg0);
	c_this->Process(c_arg_tmp_arg0);
}

void bullet_b3DynamicBvhICollide_Process2(b3DynamicBvh::ICollide* c_this,b3DbvtNode* n,float tmp_arg1){
	b3DbvtNode const * c_arg_n=(b3DbvtNode const *)(void*)(n);
	b3Scalar c_arg_tmp_arg1=tmp_arg1;
	c_this->Process(c_arg_n,c_arg_tmp_arg1);
}

b3DynamicBvh::IClone* bullet_Newb3DynamicBvhIClone(){
	b3DynamicBvh::IClone* wrap_out = new b3DynamicBvh::IClone();
	return wrap_out;
}

b3DynamicBvh* bullet_Newb3DynamicBvh(){
	b3DynamicBvh* wrap_out = new b3DynamicBvh();
	return wrap_out;
}

void bullet_b3DynamicBvh_benchmark(b3DynamicBvh* c_this){
	c_this->benchmark();
}

void bullet_b3DynamicBvh_clear(b3DynamicBvh* c_this){
	c_this->clear();
}

void bullet_b3DynamicBvh_clone(b3DynamicBvh* c_this,b3DynamicBvh* dest,b3DynamicBvh::IClone* iclone){
	b3DynamicBvh& c_arg_dest=(b3DynamicBvh&)(*dest);
	b3DynamicBvh::IClone * c_arg_iclone=(b3DynamicBvh::IClone *)(void*)(iclone);
	c_this->clone(c_arg_dest,c_arg_iclone);
}

int bullet_b3DynamicBvh_countLeaves(b3DynamicBvh* c_this,b3DbvtNode* node){
	b3DbvtNode const * c_arg_node=(b3DbvtNode const *)(void*)(node);
	int c_out = c_this->countLeaves(c_arg_node);
	int wrap_out = (c_out);
	return wrap_out;
}

bool bullet_b3DynamicBvh_empty(b3DynamicBvh* c_this){
	bool c_out = c_this->empty();
	bool wrap_out = (c_out);
	return wrap_out;
}

b3DbvtNode** bullet_b3DynamicBvh_GetFieldOfM_free(b3DynamicBvh* c_this){
	return (b3DbvtNode**)(&c_this->m_free);
}

int bullet_b3DynamicBvh_GetFieldOfM_leaves(b3DynamicBvh* c_this){
	return (int)(c_this->m_leaves);
}

int bullet_b3DynamicBvh_GetFieldOfM_lkhd(b3DynamicBvh* c_this){
	return (int)(c_this->m_lkhd);
}

unsigned int bullet_b3DynamicBvh_GetFieldOfM_opath(b3DynamicBvh* c_this){
	return (unsigned int)(c_this->m_opath);
}

b3DbvtNode** bullet_b3DynamicBvh_GetFieldOfM_root(b3DynamicBvh* c_this){
	return (b3DbvtNode**)(&c_this->m_root);
}

b3DbvtNode* bullet_b3DynamicBvh_insert(b3DynamicBvh* c_this,b3DbvtAabbMm* box,void* data){
	b3DbvtVolume const& c_arg_box=(b3DbvtVolume const&)(*box);
	void * c_arg_data=(void *)(void*)(data);
	b3DbvtNode * c_out = c_this->insert(c_arg_box,c_arg_data);
	b3DbvtNode* wrap_out = (b3DbvtNode*)(void*)(c_out);
	return wrap_out;
}

int bullet_b3DynamicBvh_maxdepth(b3DynamicBvh* c_this,b3DbvtNode* node){
	b3DbvtNode const * c_arg_node=(b3DbvtNode const *)(void*)(node);
	int c_out = c_this->maxdepth(c_arg_node);
	int wrap_out = (c_out);
	return wrap_out;
}

int bullet_b3DynamicBvh_nearest(b3DynamicBvh* c_this,int* i,b3DynamicBvh::sStkNPS* a,float v,int l,int h){
	int const * c_arg_i=(int const *)(void*)(i);
	b3DynamicBvh::sStkNPS const * c_arg_a=(b3DynamicBvh::sStkNPS const *)(void*)(a);
	b3Scalar c_arg_v=v;
	int c_arg_l=l;
	int c_arg_h=h;
	int c_out = c_this->nearest(c_arg_i,c_arg_a,c_arg_v,c_arg_l,c_arg_h);
	int wrap_out = (c_out);
	return wrap_out;
}

void bullet_b3DynamicBvh_optimizeBottomUp(b3DynamicBvh* c_this){
	c_this->optimizeBottomUp();
}

void bullet_b3DynamicBvh_optimizeIncremental(b3DynamicBvh* c_this,int passes){
	int c_arg_passes=passes;
	c_this->optimizeIncremental(c_arg_passes);
}

void bullet_b3DynamicBvh_optimizeTopDown(b3DynamicBvh* c_this,int bu_treshold){
	int c_arg_bu_treshold=bu_treshold;
	c_this->optimizeTopDown(c_arg_bu_treshold);
}

void bullet_b3DynamicBvh_remove(b3DynamicBvh* c_this,b3DbvtNode* leaf){
	b3DbvtNode * c_arg_leaf=(b3DbvtNode *)(void*)(leaf);
	c_this->remove(c_arg_leaf);
}

void bullet_b3DynamicBvh_update(b3DynamicBvh* c_this,b3DbvtNode* leaf,int lookahead){
	b3DbvtNode * c_arg_leaf=(b3DbvtNode *)(void*)(leaf);
	int c_arg_lookahead=lookahead;
	c_this->update(c_arg_leaf,c_arg_lookahead);
}

void bullet_b3DynamicBvh_update1(b3DynamicBvh* c_this,b3DbvtNode* leaf,b3DbvtAabbMm* volume){
	b3DbvtNode * c_arg_leaf=(b3DbvtNode *)(void*)(leaf);
	b3DbvtVolume& c_arg_volume=(b3DbvtVolume&)(*volume);
	c_this->update(c_arg_leaf,c_arg_volume);
}

bool bullet_b3DynamicBvh_update2(b3DynamicBvh* c_this,b3DbvtNode* leaf,b3DbvtAabbMm* volume,b3Vector3* velocity,float margin){
	b3DbvtNode * c_arg_leaf=(b3DbvtNode *)(void*)(leaf);
	b3DbvtVolume& c_arg_volume=(b3DbvtVolume&)(*volume);
	b3Vector3 const& c_arg_velocity=(b3Vector3 const&)(*velocity);
	b3Scalar c_arg_margin=margin;
	bool c_out = c_this->update(c_arg_leaf,c_arg_volume,c_arg_velocity,c_arg_margin);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_b3DynamicBvh_update3(b3DynamicBvh* c_this,b3DbvtNode* leaf,b3DbvtAabbMm* volume,b3Vector3* velocity){
	b3DbvtNode * c_arg_leaf=(b3DbvtNode *)(void*)(leaf);
	b3DbvtVolume& c_arg_volume=(b3DbvtVolume&)(*volume);
	b3Vector3 const& c_arg_velocity=(b3Vector3 const&)(*velocity);
	bool c_out = c_this->update(c_arg_leaf,c_arg_volume,c_arg_velocity);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_b3DynamicBvh_update4(b3DynamicBvh* c_this,b3DbvtNode* leaf,b3DbvtAabbMm* volume,float margin){
	b3DbvtNode * c_arg_leaf=(b3DbvtNode *)(void*)(leaf);
	b3DbvtVolume& c_arg_volume=(b3DbvtVolume&)(*volume);
	b3Scalar c_arg_margin=margin;
	bool c_out = c_this->update(c_arg_leaf,c_arg_volume,c_arg_margin);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_b3DynamicBvh_write(b3DynamicBvh* c_this,b3DynamicBvh::IWriter* iwriter){
	b3DynamicBvh::IWriter * c_arg_iwriter=(b3DynamicBvh::IWriter *)(void*)(iwriter);
	c_this->write(c_arg_iwriter);
}

b3DbvtNode* bullet_Newb3DbvtNode(){
	b3DbvtNode* wrap_out = new b3DbvtNode();
	return wrap_out;
}

b3DbvtNode** bullet_b3DbvtNode_GetFieldOfParent(b3DbvtNode* c_this){
	return (b3DbvtNode**)(&c_this->parent);
}

b3DbvtAabbMm* bullet_b3DbvtNode_GetFieldOfVolume(b3DbvtNode* c_this){
	return (b3DbvtAabbMm*)(&c_this->volume);
}

bool bullet_b3DbvtNode_isinternal(b3DbvtNode* c_this){
	bool c_out = c_this->isinternal();
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_b3DbvtNode_isleaf(b3DbvtNode* c_this){
	bool c_out = c_this->isleaf();
	bool wrap_out = (c_out);
	return wrap_out;
}

b3DbvtAabbMm* bullet_Newb3DbvtAabbMm(){
	b3DbvtAabbMm* wrap_out = new b3DbvtAabbMm();
	return wrap_out;
}

b3Vector3* bullet_b3DbvtAabbMm_Center(b3DbvtAabbMm* c_this){
	b3Vector3 c_out = c_this->Center();
	b3Vector3* wrap_out = new b3Vector3(c_out);
	return wrap_out;
}

int bullet_b3DbvtAabbMm_Classify(b3DbvtAabbMm* c_this,b3Vector3* n,float o,int s){
	b3Vector3 const& c_arg_n=(b3Vector3 const&)(*n);
	b3Scalar c_arg_o=o;
	int c_arg_s=s;
	int c_out = c_this->Classify(c_arg_n,c_arg_o,c_arg_s);
	int wrap_out = (c_out);
	return wrap_out;
}

bool bullet_b3DbvtAabbMm_Contain(b3DbvtAabbMm* c_this,b3DbvtAabbMm* a){
	b3DbvtAabbMm const& c_arg_a=(b3DbvtAabbMm const&)(*a);
	bool c_out = c_this->Contain(c_arg_a);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_b3DbvtAabbMm_Expand(b3DbvtAabbMm* c_this,b3Vector3* e){
	b3Vector3 const& c_arg_e=(b3Vector3 const&)(*e);
	c_this->Expand(c_arg_e);
}

b3Vector3* bullet_b3DbvtAabbMm_Extents(b3DbvtAabbMm* c_this){
	b3Vector3 c_out = c_this->Extents();
	b3Vector3* wrap_out = new b3Vector3(c_out);
	return wrap_out;
}

b3DbvtAabbMm* bullet_b3DbvtAabbMm_FromCE(b3DbvtAabbMm* c_this,b3Vector3* c,b3Vector3* e){
	b3Vector3 const& c_arg_c=(b3Vector3 const&)(*c);
	b3Vector3 const& c_arg_e=(b3Vector3 const&)(*e);
	b3DbvtAabbMm c_out = c_this->FromCE(c_arg_c,c_arg_e);
	b3DbvtAabbMm* wrap_out = new b3DbvtAabbMm(c_out);
	return wrap_out;
}

b3DbvtAabbMm* bullet_b3DbvtAabbMm_FromCR(b3DbvtAabbMm* c_this,b3Vector3* c,float r){
	b3Vector3 const& c_arg_c=(b3Vector3 const&)(*c);
	b3Scalar c_arg_r=r;
	b3DbvtAabbMm c_out = c_this->FromCR(c_arg_c,c_arg_r);
	b3DbvtAabbMm* wrap_out = new b3DbvtAabbMm(c_out);
	return wrap_out;
}

b3DbvtAabbMm* bullet_b3DbvtAabbMm_FromMM(b3DbvtAabbMm* c_this,b3Vector3* mi,b3Vector3* mx){
	b3Vector3 const& c_arg_mi=(b3Vector3 const&)(*mi);
	b3Vector3 const& c_arg_mx=(b3Vector3 const&)(*mx);
	b3DbvtAabbMm c_out = c_this->FromMM(c_arg_mi,c_arg_mx);
	b3DbvtAabbMm* wrap_out = new b3DbvtAabbMm(c_out);
	return wrap_out;
}

b3DbvtAabbMm* bullet_b3DbvtAabbMm_FromPoints(b3DbvtAabbMm* c_this,b3Vector3* pts,int n){
	b3Vector3 const * c_arg_pts=(b3Vector3 const *)(void*)(pts);
	int c_arg_n=n;
	b3DbvtAabbMm c_out = c_this->FromPoints(c_arg_pts,c_arg_n);
	b3DbvtAabbMm* wrap_out = new b3DbvtAabbMm(c_out);
	return wrap_out;
}

b3DbvtAabbMm* bullet_b3DbvtAabbMm_FromPoints1(b3DbvtAabbMm* c_this,b3Vector3** ppts,int n){
	b3Vector3 const * * c_arg_ppts=(b3Vector3 const * *)(void*)(ppts);
	int c_arg_n=n;
	b3DbvtAabbMm c_out = c_this->FromPoints(c_arg_ppts,c_arg_n);
	b3DbvtAabbMm* wrap_out = new b3DbvtAabbMm(c_out);
	return wrap_out;
}

b3Vector3* bullet_b3DbvtAabbMm_Lengths(b3DbvtAabbMm* c_this){
	b3Vector3 c_out = c_this->Lengths();
	b3Vector3* wrap_out = new b3Vector3(c_out);
	return wrap_out;
}

b3Vector3* bullet_b3DbvtAabbMm_Maxs(b3DbvtAabbMm* c_this){
	b3Vector3 const& c_out = c_this->Maxs();
	b3Vector3* wrap_out = (b3Vector3*)(&c_out);
	return wrap_out;
}

b3Vector3* bullet_b3DbvtAabbMm_Mins(b3DbvtAabbMm* c_this){
	b3Vector3 const& c_out = c_this->Mins();
	b3Vector3* wrap_out = (b3Vector3*)(&c_out);
	return wrap_out;
}

float bullet_b3DbvtAabbMm_ProjectMinimum(b3DbvtAabbMm* c_this,b3Vector3* v,unsigned int signs){
	b3Vector3 const& c_arg_v=(b3Vector3 const&)(*v);
	unsigned int c_arg_signs=signs;
	b3Scalar c_out = c_this->ProjectMinimum(c_arg_v,c_arg_signs);
	float wrap_out = (c_out);
	return wrap_out;
}

void bullet_b3DbvtAabbMm_SignedExpand(b3DbvtAabbMm* c_this,b3Vector3* e){
	b3Vector3 const& c_arg_e=(b3Vector3 const&)(*e);
	c_this->SignedExpand(c_arg_e);
}

b3Vector3* bullet_b3DbvtAabbMm_tMaxs(b3DbvtAabbMm* c_this){
	b3Vector3& c_out = c_this->tMaxs();
	b3Vector3* wrap_out = (b3Vector3*)(&c_out);
	return wrap_out;
}

b3Vector3* bullet_b3DbvtAabbMm_tMins(b3DbvtAabbMm* c_this){
	b3Vector3& c_out = c_this->tMins();
	b3Vector3* wrap_out = (b3Vector3*)(&c_out);
	return wrap_out;
}

#ifdef __cplusplus
}
#endif
